package com.myspace.server.user.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Builder;
import lombok.Data;

import java.time.LocalDate;
import java.time.LocalDateTime;

/**
 * 用户实体
 * @author peng.zhang
 */
@Data
@Builder
@TableName("user")
@ApiModel(value = "User", description = "用户实体")
public class User {

    @TableId(type = IdType.AUTO)
    @ApiModelProperty(value = "用户 ID")
    private Long id;

    @TableField("username")
    @ApiModelProperty(value = "用户名")
    private String username;

    @TableField("password")
    @JsonIgnore
    @ApiModelProperty(value = "密码")
    private String password;

    @TableField("nickname")
    @ApiModelProperty(value = "昵称")
    private String nickname;

    @TableField("sex")
    @ApiModelProperty(value = "性别")
    private Integer sex;

    @TableField("birthday")
    @ApiModelProperty(value = "出生日期")
    private LocalDate birthday;

    @TableField("avatar")
    @ApiModelProperty(value = "头像")
    private String avatar;

    @TableField( "maxim")
    @ApiModelProperty(value = "格言")
    private String maxim;

    @TableField("phone")
    @ApiModelProperty(value = "电话")
    private String phone;

    @TableField("email")
    @ApiModelProperty(value = "邮箱")
    private String email;

    @TableField("qq")
    @ApiModelProperty(value = "QQ")
    private String qq;

    @TableField("location")
    @ApiModelProperty(value = "地区")
    private String location;

    @TableField("create_time")
    @ApiModelProperty(value = "创建时间")
    private LocalDateTime createTime;

}
